package run.vue.iblog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import run.vue.iblog.entity.Category;
import run.vue.iblog.mapper.CategoryMapper;
import run.vue.iblog.service.CategoryService;

import java.util.List;

@Service
public class CategoryServiceImpl  extends ServiceImpl<CategoryMapper, Category> implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> listAll() {
        return categoryMapper.findAll();
    }

    // 暂时保留
    @Override
    public Category get(int id) {
        Category category = categoryMapper.get(id);
        return category == null ? null:category;
    }
}
